<html>
	<head>
		<link rel="stylesheet" href="/static/layui/css/layui.css"  media="all">
		<link rel="stylesheet" href="/static/cloud/css/cloud.css" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<script src="/static/layui/layui.js"></script>
		<title>私人云盘</title>
	</head>
	<body>
		<style type="text/css">
			body{background: #f2f2f2;overflow: hidden;}
			#cloud-content{height: calc(100% - 60px);overflow: auto}
			#cloud-user{cursor: pointer;float: right;height: 59px}

			#cloud-user:hover{color: #e6e6e6}
			@media (max-width: 500px){
				#cloud-user-head{margin-top:16px}
				#cloud-user-head img{margin-right:0}
				#cloud-user-name{display: none;}
			}
		</style>
		<ul id='top-menu' class="layui-nav layui-bg-blue">

		  	<li class="layui-nav-item"><a href="/index/file_list">私有云盘</a></li>
		  	<li class="layui-nav-item"><a href="/index/file">文件</a></li>
		  	<li class="layui-nav-item"><a href="/index/share">分享</a></li>
		  	<li class="layui-nav-item"><a href="/index/tools">其他</a></li>
		  	<!-- <li class="layui-nav-item"><a href="">群组</a></li>
		  	<li class="layui-nav-item"><a href="">社区</a></li> -->
	
		  	<li class="layui-nav-item cloud-user-card" id="cloud-user" lay-unselect="">
		  		<div class="layui-inline" id="cloud-user-head">
		  			<img src="/static/cloud/image/head_image.png" onerror="this.src='/static/cloud/image/head_image.png'" class="layui-nav-img">
		  		</div>
		  	  	<div class="layui-inline" id='cloud-user-name'>----</div>
		  	</li>
	
		</ul> 
		<div id='cloud-content' path="">
			<!-- <iframe src="http://disk.cn/index/online_play_video?file_id=4" style="width:100%;height:100%" frameborder=0></iframe> -->
		</div>

		<div id='template-content' class="layui-hide"></div>
		
		<script type="text/javascript">
			var app;
			layui.config({
				base: '/static/layui_extends/'
				,version: true//禁止浏览器缓存，此处建议禁止
			})
			layui.use(['layer','jquery','app','my_base'],function(){
				var $=layui.jquery
				,layer=layui.layer;
				app=layui.app;
				app.init({
					contentElemId:'cloud-content',
					config: {
						viewUrlApi: ''
					},
					success:function(){
						console.log('初始化结束');
						// 核心扩展方法
						app.base = layui.my_base;

						app.ajaxPost('/api/user/userinfo', '', function (d) {
							if (d.data.head_image) {
								$('#cloud-user img').attr('src', d.data.head_image);
							}
							$('#cloud-user-name').text(d.data.name)
						})
						app.goToPage(app.getUrl());
						
						$('#cloud-user').click(function () {
							var obj = {}
							obj.head_image = $('#cloud-user img').attr('src')
							obj.name = $('#cloud-user-name').text()
							app.runTpl('user_menu', obj)
						})
						
					}
				})
				
			})
		</script>
	</body>
</html>